//第一题
let arr = ["item1", "item2", "item3", "item4", "item5"];
let insert = [
  { content: "section1", index: 0 },
  { content: "section2", index: 2 },
];
const injectSections=(arr, insertPosition)=>{
  insertPosition.forEach((item, index) => {
    arr.splice(item.index + index, 0, item.content);
  });
  return arr;
}
//[("section1", "item1", "item2", "section2", "item3", "item4", "item5")];
console.log(injectSections(arr, insert))
//第二题
const initArray=(m,n)=>{
    let arr=new Array(m).fill(n);
    return arr;
}
console.log(initArray(10, 2))
